package com.sq.partner.manager.service;

import java.util.List;
import java.util.Map;

import com.sq.partner.manager.mybatis.model.GatewayMenu;
import com.sq.partner.manager.util.Page;

public interface IGatewayMenuService {
	
	/**
	 * left页面初始化时查询当前用户角色下所有的各等级菜单
	 * @param usercode 用户代码
	 * @return
	 * @throws Exception
	 */
	List<GatewayMenu> getAllMenus(long userid) throws Exception;

	/**
	 * 分页查询菜单列表
	 * @param page
	 * @param PageIndex
	 * @param menu
	 * @return
	 * @throws Exception
	 */
	Page queryPage(Page page,Integer PageIndex,GatewayMenu menu) throws Exception;
	
	
	/**
	 * 添加菜单
	 * @param menu
	 * @return
	 * @throws Exception
	 */
	boolean addMenu(GatewayMenu menu) throws Exception ;
	
	/**
	 * 编辑菜单
	 * @param menu
	 * @return
	 * @throws Exception
	 */
	boolean modifyMenu(GatewayMenu menu) throws Exception ;
	
	/**
	 * 编辑菜单时，选择上级菜单，查询登录用户的角色下所拥有的等级菜单列表，不包括编辑的菜单
	 * @param userid
	 * @return
	 * @throws Exception
	 */
	List<GatewayMenu> getAllMenusExceptSelf(Long menuid) throws Exception;

	
	/**
	 * 删除菜单
	 * @param menu
	 * @return
	 * @throws Exception
	 */
	boolean deleteMenu(Long menuid) throws Exception ;
	
	/**
	 * 查询子菜单
	 * @param parentMenuid
	 * @return
	 * @throws Exception
	 */
	List<GatewayMenu> queryChildMenuIsExists(Long parentMenuid) throws Exception;
	
	
	/**
	 * 查询所有菜单，无权限
	 * @param parentMenuid
	 * @return
	 * @throws Exception
	 */
	List<GatewayMenu> queryAllMenuIsAsParentMenu(Map<String,Object> map) throws Exception;
	
	/**
	 * 查询某个菜单的详细信息
	 * @param map
	 * @return
	 * @throws Exception
	 */
	GatewayMenu queryMenuInfo(Long menuid) throws Exception;

}
